using System;
using System.Security.Principal;
using Neo.MetaModel;


namespace Neo.Generator.Core
{

	///<summary>A velocity context for Neo generation
	///</summary>
	public class GenerationContext
	{
		//--------------------------------------------------------------------------------------
		//	fields / constructor
		//--------------------------------------------------------------------------------------

		private Model	model;

        /// <summary>
        /// Initializes a new instance of the <see cref="GenerationContext"/> class.
        /// </summary>
		protected GenerationContext()
		{
		}

        /// <summary>
        /// Initializes a new instance of the <see cref="GenerationContext"/> class.
        /// </summary>
        /// <param name="aModel">A model.</param>
		public GenerationContext(Model aModel)
		{
		    model = aModel;
		}

		
		//--------------------------------------------------------------------------------------
		//	properties
		//--------------------------------------------------------------------------------------

        /// <summary>
        /// Gets the model.
        /// </summary>
        /// <value>The model.</value>
		public virtual Model Model
		{
			get { return model; }
		}

        /// <summary>
        /// Gets the date.
        /// </summary>
        /// <value>The date.</value>
		public string Date
		{
			get { return DateTime.Now.ToString(); }
		}

        /// <summary>
        /// Gets the user.
        /// </summary>
        /// <value>The user.</value>
		public string User
		{
			get { return WindowsIdentity.GetCurrent().Name; }
		}

        /// <summary>
        /// Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
        /// </returns>
		public override string ToString()
		{
			return "Knock, knock, Neo.";
		}
	
	}
}
